home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / vidhandl / setmode.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-03  |  755 b   |  35 lines

  1. //Simple program that selects video mode.
  2. //by Marcio A. A. Fialho
  3.  
  4. #include <stdio.h>
  5. #include <ctype.h>
  6.  
  7. #include "hextoi.c"
  8.   //hextoi defined in HEXTOI.C converts a string in hexadecimal notation to a integer
  9.  
  10. void main (int n, char *ent[2])
  11.  {
  12.     int a0; //a0 = mode
  13.     if (n<2)
  14.      {
  15.         fputs("\n\
  16. SETMODE ver 1.0 - Selects current video mode\n\n\
  17. \tUsage: SETMODE <videomode> \n\n\
  18. \t<videomode> => new video mode (must be in hexadecimal notation)\n\n\
  19. by Márcio Afonso Arimura Fialho\n\
  20. Freeware / Public Domain",stdout);
  21.         return;
  22.      }
  23.  
  24.     if (hextoi(&a0,ent[1]))
  25.      {
  26.         fputs("ERROR:Input parameter is incorrect.\n\
  27. Type SETMODE with no parameters to get help",stdout);
  28.         return;
  29.      }
  30.  
  31.     _AH=0;
  32.     _AL=a0;
  33.    asm int 0x10;
  34.  }
  35.